package cn.itsource.basic.util;

import cn.hutool.http.HttpUtil;

/**
 * 发送短信的工具类
 */
public class MobileMessageUtil {

    public static void sendMessage(String phone,String code){
        //http://utf8.api.smschinese.cn/?Uid=%s&Key=%s&smsMob=%s&smsText=验证码:%s
        String url = String.format(PetConstant.SEND_MOBILE_MESSAGE_URL, PetConstant.MOBILE_ACCOUNT, PetConstant.MOBILE_SECRET, phone, code);

        System.out.println(url);

        HttpUtil.get(url);
    }


    public static void main(String[] args) {
        String s = "我是%s,我今年%s岁";
        String url = String.format(s, "王天霸", 12);
        System.out.println(url);//我是王天霸,我今年12岁

    }
}
